#include <iostream>
#include <sstream>
using namespace std;

typedef struct Node{
        int value;
        struct Node *left;
        struct Node *right;
} node,*BiTree;

int getRootIndex(int A[],int l,int r, int key){
        for(int i=l;i<r;i++){
                if(A[i]==key)
                        return i;
        }
        return -1;
}

int n,*mos,*aos;

void createBiTree(BiTree &bitree, int ml,int mr, int al,int ar)
{
        if(ml<mr){
                bitree = new node;
                bitree->value = aos[ar-1];
                bitree->left = nullptr;
                bitree->right= nullptr;
                int index = getRootIndex(mos,ml,mr,aos[ar-1]);
                createBiTree(bitree->left, ml,index,al,al+index-ml);
                createBiTree(bitree->right,index+1,mr,al+index-ml,ar-1);
        }
}

node **levelTraversal(BiTree bt){
        node** los = new node*[n];
        int t,s;
        t = 0, s = 1,los[0] = bt;
        while( s>0 ){
                if(los[t]->left!=nullptr){
                        los[t+s] = los[t]->left;
                        s++;
                }
                if(los[t]->right!=nullptr){
                        los[t+s] = los[t]->right;
                        s++;
                }
                t++,s--;
        }
        return los;
}

void trans_mirror( BiTree bt) {
	if( bt==nullptr)
		return ;
	BiTree t = bt->left;
	bt->left = bt->right;
	bt->right = t;
	trans_mirror(bt->left);
	trans_mirror(bt->right);
}
int main()
{
	
	return 0;
}
